﻿
/*
* Copyright(C) 2006 - 2010
* Athor:clove
* Company:minyoo network co,ltd.
* Create date:2006-06-01
* 
* */
// waiting time
var wtime = 0;

// table row list size
var listsize = 15;

// go to minyoo home page
function gotoMinyoo() {
    window.open("http://www.minyoo.cn");
}

// preview page
function preview() {
    var previewurl = document.all.previewurl;
    if (previewurl) {
        window.open(previewurl.value);
    }
}

// select site
function selectSite(obj, f) {
    var thisform = eval("document." + f);
    if (thisform) {
        if (obj.value * 1 > 0) {
            thisform.submit();
        }
    }
}

// parent is login page
function openLoginPage() {
    if (window.top != self) {
        window.top.location = self.location;
    }
}

// Refresh bottom frame
function refreshBottomFrame() {
    var s = parent.Top.topForm.refreshBottom;
    if (s && s.value * 1 == 1) {
        parent.Bottom.location.reload();
    }
}

// Refresh bottom frame 2
function refreshBottomFrame2() {
    var s = parent.parent.Top.topForm.webid;
    var n = document.all.webid;
    if (s && n) {
        if (s.value * 1 != n.value * 1) {
            self.location.reload();
        }
    }
}
// alert login info
function alertLogin() {
    var userobj = document.loginForm.username;
    var passobj = document.loginForm.password;
    if (userobj && passobj) {
        if (userobj.value) {
            passobj.value = "";
            alert("\u60a8\u8f93\u5165\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u4e0d\u6b63\u786e\u6216\u60a8\u7684\u7528\u6237\u6743\u9650\u4e0d\u8db3\uff0c\u8bf7\u91cd\u8bd5\uff01");
        }
    } else {
        alert("login form is invalid!");
    }
}

// Refresh left frame
function refreshLeftFrame() {
    var s = document.all.refreshLeft;
    if (s && s.value * 1 == 1) {
        parent.leftFrame.location.reload();
    }
}

// do code
function doCode(pf, obj, innerId) {
    var temp = "";
    //pf.value = checkURL(pf.value) ? pf.value : "about:blank";
    if (obj) {
        temp = obj.value.replace("&lt;", "<");
        temp = obj.value.replace("&gt;", ">");
        temp = obj.value.replace("<Script", "<script");
        temp = obj.value.replace("<SCRIPT", "<script");
        if (pf != null && pf != "") {
            temp = obj.value.replace("{plugin_url}", pf.value);
        }
        if (temp.indexOf("<script") > -1) {
            temp = "</script>" + temp + "<script LANGUAGE=\"JavaScript\">";
        }
    }
    set_innerHTML(innerId, temp);
}

//unicode to char
function unicode2Char(str) {
    if (str != null && "" != str) {
        var st, t, i;
        st = "";
        for (i = 1; i <= str.length / 4; i++) {
            t = str.slice(4 * i - 4, 4 * i - 2);
            t = str.slice(4 * i - 2, 4 * i).concat(t);
            st = st.concat("%u").concat(t);
        }
        st = unescape(st);
        return (st);
    } else {
        return ("");
    }
}

// char to unicode
function char2Unicode(str) {
    if (str != null && "" != str) {
        var st, t, i;
        st = "";
        for (i = 1; i <= str.length; i++) {
            t = str.charCodeAt(i - 1).toString(16);
            if (t.length < 4) {
                while (t.length < 4) {
                    t = "0".concat(t);
                }
            }
            t = t.slice(2, 4).concat(t.slice(0, 2));
            st = st.concat(t);
        }
        return (st.toUpperCase());
    } else {
        return ("");
    }
}

// replace blank
function replaceBlank(f, c) {
    var obj = eval("document.all." + f);
    if (obj) {
        var str = obj.value;
        if ("" != str) {
            var st, t, i;
            st = "";
            for (i = 1; i <= str.length; i++) {
                t = str.charCodeAt(i - 1).toString(16);
                if (t.length < 4) {
                    while (t.length < 4) {
                        t = "0".concat(t);
                    }
                }
                t = t.slice(2, 4).concat(t.slice(0, 2));
                t = t.toUpperCase();
                if (t == "A000") {
                    t = "2000";
                }
                st = st.concat(t);
            }
        }
        st = unicode2Char(st);
        st = st.replace(/[ ]/g, "&nbsp;");
        return st;
    }
}

// insert code
function insertCode(n, obj) {
    if (n * 1 == 0) {
        obj.value = "<iframe src=\"{plugin_url}\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"auto\"></iframe>";
    } else {
        obj.value = "<script language=\"javascript\" src=\"{plugin_url}\"></script>";
    }
}

// Show waiting image
function showWaiting() {
    if (document.all.waitingImage && document.all.saveForm.onsubmit) {
        setInterval("getWaitingTime();", 1000);
        document.all.waitingImage.style.display = "";
    }
}

// get waiting time
function getWaitingTime() {
    document.getElementById("waitingTime").innerHTML = "[<font color='#0000ff'>" + wtime + "</font>S]";
    wtime = wtime + 1;
}

// TextArea auto scrolling 
function doTextAreaScroll(obj) {
    if (obj) {
        obj.style.posHeight = obj.scrollHeight;
    }
    return true;
}

// set filedset height
function setFiledsetHeight(obj) {
    if (document.all.fieldsetObj) {
        document.all.fieldsetObj.style.height = document.all.fieldsetObj.style.height + obj.Height - 20;
    }
}

// must enter number for onkeyup
function maskNum(obj) {
    if (obj) {
        obj.value = obj.value.replace(/[^\d]/g, "");
    }
    return true;
}

// must parse number
function maskNum_c(obj) {
    clipboardData.setData("text", clipboardData.getData("text").replace(/[^\d]/g, ""));
}

// page show
function pageShow() {
    totalCount = document.all.totalCount.value;
    currentPage = document.all.hiddenCurrentPage.value;
    pageSize = document.all.pageSize.value;
    totalPage = Math.round(totalCount / pageSize);
    document.write("\u5171<I><U>" + totalCount + "</U></I>\u6761\u4fe1\u606f\uff0c");
    document.write("\u5206<I><U>" + ((totalPage < 1) ? 1 : totalPage) + "</U></I>\u9875\u663e\u793a\uff0c");
    document.write("\u6bcf\u9875<I><U>" + pageSize + "</U></I>\u6761\u4fe1\u606f\uff0c");
    document.write("\u5f53\u524d\u4f4d\u4e8e\u7b2c<I><U>" + currentPage + "</U></I>\u9875\u3002");
}

// input ip mask
function maskIp(obj, nextobj) {
    obj.value = obj.value.replace(/[^\d]/g, "");
    if (obj.value.length >= 3) {
        if (parseInt(obj.value) >= 256 || parseInt(obj.value) <= 0) {
            obj.value = "";
            obj.focus();
            return false;
        } else {
            obj.blur();
            eval("document.all." + nextobj + ".focus()");
        }
    }
}

// copy and parse ip mask
function maskIp_c(obj) {
    clipboardData.setData("text", clipboardData.getData("text").replace(/[^\d]/g, ""));
}

// input email mask
function maskEmail(obj) {
    var partrn = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
    if (!partrn.test(obj.value)) {
        obj.value = "yourname@yourdomain.com";
    }
}

// copy and parse email mask
function maskEmail_c(obj) {
    var partrn = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
    if (!partrn.test(clipboardData.getData("text"))) {
        clipboardData.setData("text", "yourname@yourdomain.com");
    }
}

// set selected objects
function setSelectedObj() {
    var obj = document.all.objSet.value;
    if (!obj) {
        return;
    }
    var objSplit = obj.split(".");
    var len = objSplit.length;
    if (len < 2) {
        return;
    }
    if (!document.all.checkbox) {
        return;
    }
    for (var i = 1; i < len; i++) {
        for (var j = 0; j < document.all.entryCount.value; j++) {
            if (document.all.id.value == objSplit[i]) {
                document.all.checkbox.checked = true;
            }
            var obj_id = eval("document.all.id_" + j);
            var obj_box = eval("document.all.checkbox_" + j);
            if (!obj_id || !obj_box) {
                continue;
            }
            if (obj_id.value == objSplit[i]) {
                obj_box.checked = true;
            }
        }
    }
}

// get selected objects
function getSelectedObj() {
    var itemSelected = "";
    if (!document.all.checkbox) {
        return;
    }
    if (document.all.checkbox.checked) {
        itemSelected += document.all.id.value + ".";
    }
    for (var j = 0; j < document.all.entryCount.value - 1; j++) {
        var obj = eval("document.all.checkbox_" + j);
        if (obj && obj.checked) {
            itemSelected += eval("document.all.id_" + j).value + ".";
        }
    }
    var len = itemSelected.length;
    if (len > 0 && document.all.objGet) {
        document.all.objGet.value = itemSelected.substring(0, len - 1);
    }
}

// do template update way
function doTplUpdate() {
    if (document.all.state.value * 1 > 0) {
        document.all.oldTpl.style.display = "";
        document.all.tpl1.style.display = "none";
        document.all.tpl2.style.display = "none";
        document.all.tpl3.style.display = "none";
        document.all.tpl4.style.display = "none";
        document.all.tpl5.style.display = "";
    } else {
        document.all.tpl5.style.display = "none";
    }
}

// do attachment update way
function doAtmUpdate() {
    if (document.all.state.value * 1 > 0) {
        document.all.oldAtm.style.display = "";
        document.all.atm1.style.display = "none";
        document.all.atm2.style.display = "none";
        document.all.atm3.style.display = "none";
        document.all.atm4.style.display = "none";
        document.all.atm5.style.display = "none";
    }
}

// preload images
function MM_preloadImages() {
    var d = document;
    if (d.images) {
        if (!d.MM_p) {
            d.MM_p = new Array();
        }
        var i, j = d.MM_p.length, a = MM_preloadImages.arguments;
        for (i = 0; i < a.length; i++) {
            if (a[i].indexOf("#") != 0) {
                d.MM_p[j] = new Image;
                d.MM_p[j++].src = a[i];
            }
        }
    }
}

// find object
function MM_findObj(n, d) {
    var p, i, x;
    if (!d) {
        d = document;
    }
    if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document;
        n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all) {
        x = d.all[n];
    }
    for (i = 0; !x && i < d.forms.length; i++) {
        x = d.forms[i][n];
    }
    for (i = 0; !x && d.layers && i < d.layers.length; i++) {
        x = MM_findObj(n, d.layers[i].document);
    }
    if (!x && d.getElementById) {
        x = d.getElementById(n);
    }
    return x;
}

// swap image
function MM_swapImage() {
    var i, j = 0, x, a = MM_swapImage.arguments;
    document.MM_sr = new Array;
    for (i = 0; i < (a.length - 2); i += 3) {
        if ((x = MM_findObj(a[i])) != null) {
            document.MM_sr[j++] = x;
            if (!x.oSrc) {
                x.oSrc = x.src;
            }
            x.src = a[i + 2];
        }
    }
}

// swap image judge
function MM_swapImage_judge() {
    var objsrc, newsrc;
    objsrc = document.all.switchPoint.src.slice(-6);
    if (objsrc == "l1.gif") {
        newsrc = "/" + rootDir + "/module/images/frame/my_but_l2.gif";
    } else {
        if (objsrc == "r1.gif") {
            newsrc = "/" + rootDir + "/module/images/frame/my_but_r2.gif";
        }
    }
    MM_swapImage("switchPoint", "", newsrc, 1);
}

// swap image restore
function MM_swapImgRestore_judge() {
    if (frmMenu.style.display == "") {
        document.all.switchPoint.src = "/" + rootDir + "/module/images/frame/my_but_r1.gif";
    } else {
        document.all.switchPoint.src = "/" + rootDir + "/module/images/frame/my_but_l1.gif";
    }
}

// show or hide menu
function showHideMenu() {
    if (frmMenu.style.display == "") {
        frmMenu.style.display = "none";
        document.all.switchPoint.src = "/" + rootDir + "/module/images/frame/my_but_l1.gif";
    } else {
        frmMenu.style.display = "";
        document.all.switchPoint.src = "/" + rootDir + "/module/images/frame/my_but_r1.gif";
    }
    if (parseInt(document.all.leftFrame.style.width) <= 50) {
        document.all.leftFrame.style.width = 180;
    }
}

// down
function MDown(Object) {
    Obj = Object.id;
    document.all.leftFrame.setCapture();
    intWidth = event.x - parseInt(document.all.leftFrame.style.width);
}

// move
function MMove() {
    if (Obj != "") {
        var iframeWidth = event.x - intWidth;
        if (iframeWidth >= (screen.width / 4 * 3)) {
            document.all.leftFrame.style.width = (screen.width / 4 * 3);
        } else {
            if (iframeWidth >= 1) {
                document.all.leftFrame.style.width = iframeWidth;
            } else {
                document.all.leftFrame.style.width = 1;
            }
        }
    }
}

// up
function MUp() {
    if (Obj != "") {
        document.all.leftFrame.releaseCapture();
        Obj = "";
    }
}

// show attachment
function showAttachment() {
    if (document.all.fileType.value == "media") {
        document.all.mediaAtm.src = document.all.file.value;
        document.all.mediaAtm.style.display = "";
    } else {
        if (document.all.fileType.value == "flash") {
            document.all.flashAtm.src = document.all.file.value;
            document.all.flashAtm.style.display = "";
        } else {
            document.all.showAtm.src = document.all.file.value;
            document.all.showAtm.style.display = "";
        }
    }
}

// show detail more
function showDetailMore(obj1, obj2, showStatus, lenOfMore, delta) {
    var fo = document.all.fieldsetObj;
    if (fo == null) {
        return false;
    }
    if (showStatus == "") {
        obj1.style.display = "";
        obj2.style.display = "none";
        fo.style.height = parseInt(fo.style.height) + delta;
    } else {
        obj1.style.display = "none";
        obj2.style.display = "";
        fo.style.height = parseInt(fo.style.height) - delta;
    }
    for (var i = 0; i <= lenOfMore; i++) {
        var moreObj = eval("document.all.more" + i);
        if (moreObj != null) {
            moreObj.style.display = showStatus;
        }
    }
}

// date select
function selectCalendar(ctrlobj) {
    var the_url = location.href;
    var str1 = the_url.split("//");
    var str2 = str1[1];
    var str3 = str2.split("/");
    var folder = str3[1];
    retval = window.showModalDialog("/" + folder + "/module/html/CalendarDlg.html", "", "dialogWidth:235px; dialogHeight:210px; dialogLeft:300px; dialogTop:150px; status:no; directories:yes;scrollbars:no;Resizable=no;");
    if (retval != null) {
        ctrlobj.value = retval;
    }
}

// innerHtml way
var global_html_pool = [];
var global_script_pool = [];
var global_script_src_pool = [];
var global_lock_pool = [];
var innerhtml_lock = null;
var document_buffer = "";
function set_innerHTML(obj_id, html, time) {
    if (innerhtml_lock == null) {
        innerhtml_lock = obj_id;
    } else {
        if (typeof (time) == "undefined") {
            global_lock_pool[obj_id + "_html"] = html;
            window.setTimeout("set_innerHTML('" + obj_id + "', global_lock_pool['" + obj_id + "_html']);", 10);
            return;
        } else {
            if (innerhtml_lock != obj_id) {
                global_lock_pool[obj_id + "_html"] = html;
                window.setTimeout("set_innerHTML('" + obj_id + "', global_lock_pool['" + obj_id + "_html'], " + time + ");", 10);
                return;
            }
        }
    }
    function get_script_id() {
        return "script_" + (new Date()).getTime().toString(36) + Math.floor(Math.random() * 100000000).toString(36);
    }
    document_buffer = "";
    document.write = function(str) {
        document_buffer += str;
    };
    document.writeln = function(str) {
        document_buffer += str + "\n";
    };
    global_html_pool = [];
    var scripts = [];
    html = html.split(/<\/script>/i);
    for (var i = 0; i < html.length; i++) {
        global_html_pool[i] = html[i].replace(/<script[\s\S]*$/ig, "");
        scripts[i] = { text: "", src: "" };
        scripts[i].text = html[i].substr(global_html_pool[i].length);
        scripts[i].src = scripts[i].text.substr(0, scripts[i].text.indexOf(">") + 1);
        scripts[i].src = scripts[i].src.match(/src\s*=\s*(\"([^\"]*)\"|\'([^\']*)\'|([^\s]*)[\s>])/i);
        if (scripts[i].src) {
            if (scripts[i].src[2]) {
                scripts[i].src = scripts[i].src[2];
            } else {
                if (scripts[i].src[3]) {
                    scripts[i].src = scripts[i].src[3];
                } else {
                    if (scripts[i].src[4]) {
                        scripts[i].src = scripts[i].src[4];
                    } else {
                        scripts[i].src = "";
                    }
                }
            }
            scripts[i].text = "";
        } else {
            scripts[i].src = "";
            scripts[i].text = scripts[i].text.substr(scripts[i].text.indexOf(">") + 1);
            scripts[i].text = scripts[i].text.replace(/^\s*<\!--\s*/g, "");
        }
    }
    var s;
    if (typeof (time) == "undefined") {
        s = 0;
    } else {
        s = time;
    }
    var script, add_script, remove_script;
    for (var i = 0; i < scripts.length; i++) {
        var add_html = "document_buffer += global_html_pool[" + i + "];\n";
        add_html += "document.getElementById('" + obj_id + "').innerHTML = document_buffer;\n";
        script = document.createElement("script");
        if (scripts[i].src) {
            script.src = scripts[i].src;
            if (typeof (global_script_src_pool[script.src]) == "undefined") {
                global_script_src_pool[script.src] = true;
                s += 2000;
            } else {
                s += 10;
            }
        } else {
            script.text = scripts[i].text;
            s += 10;
        }
        script.defer = true;
        script.type = "text/javascript";
        script.id = get_script_id();
        global_script_pool[script.id] = script;
        add_script = add_html;
        add_script += "document.getElementsByTagName('head').item(0)";
        add_script += ".appendChild(global_script_pool['" + script.id + "']);\n";
        window.setTimeout(add_script, s);
        remove_script = "document.getElementsByTagName('head').item(0)";
        remove_script += ".removeChild(document.getElementById('" + script.id + "'));\n";
        remove_script += "delete global_script_pool['" + script.id + "'];\n";
        window.setTimeout(remove_script, s + 10000);
    }
    var end_script = "if (document_buffer.match(/<\\/script>/i)) {\n";
    end_script += "set_innerHTML('" + obj_id + "', document_buffer, " + s + ");\n";
    end_script += "}\n";
    end_script += "else {\n";
    end_script += "document.getElementById('" + obj_id + "').innerHTML = document_buffer;\n";
    end_script += "innerhtml_lock = null;\n";
    end_script += "}";
    window.setTimeout(end_script, s);
}

//set color
function showColor(objInput) {
    var sColor = document.all.dlgHelper.ChooseColorDlg();
    if (!sColor || sColor == "#NaNNaNNaN") {
        return;
    }
    sColor = sColor.toString(16);
    if (sColor.length < 6) {
        var sTempString = "000000".substring(0, 6 - sColor.length);
        sColor = sTempString.concat(sColor);
    }
    setProperty("color", "#" + sColor, objInput);
}

//set color
function showBgColor(objInput) {
    var sColor = document.all.dlgHelper.ChooseColorDlg();
    if (!sColor || sColor == "#NaNNaNNaN") {
        return;
    }
    sColor = sColor.toString(16);
    if (sColor.length < 6) {
        var sTempString = "000000".substring(0, 6 - sColor.length);
        sColor = sTempString.concat(sColor);
    }
    setProperty2("#" + sColor, objInput);
}

// set face
function setFace(src, objInput) {
    var nSize = src.value;
    if (objInput) {
        setProperty("face", nSize, objInput);
    }
}

// set size
function setSize(src, objInput) {
    var nSize = src.value;
    if (objInput) {
        setProperty("size", nSize, objInput);
    }
}

// set property
function setProperty(pName, pValue, objInput) {
    var strText = objInput.innerText;
    strText = replaceInnerText(strText);
    var idxFontRight = strText.indexOf("</FONT>");
    if (idxFontRight == -1) {
        objInput.innerText = "<FONT " + pName + "=\"" + pValue + "\">" + strText + "</FONT>";
    } else {
        var strFind = pName + "=";
        var idxProp = strText.indexOf(strFind);
        var idxFont = strText.indexOf("<FONT");
        if (idxProp == -1) {
            if (pValue != "") {
                objInput.innerText = strText.substring(0, idxFont - 1) + strText.substring(idxFont, 5) + " " + pName + "=\"" + pValue + "\"" + strText.substring(5);
            }
        } else {
            var idxSpaceGT = strText.indexOf(" >");
            if (idxSpaceGT == -1) {
                var idxGT = strText.indexOf(">");
                strText = strText.substring(0, idxGT) + " " + strText.substring(idxGT);
            }
            var remainText = strText.substring(idxProp + strFind.length);
            remainText = remainText.substring(remainText.indexOf(" "));
            if (pValue != "") {
                objInput.innerText = strText.substring(0, idxProp + strFind.length) + "\"" + pValue + "\"" + remainText;
            } else {
                objInput.innerText = strText.substring(0, idxProp) + remainText;
            }
        }
    }
}
function replaceInnerText(strText) {
    strText = strText.replace("<B>", "");
    strText = strText.replace("</B>", "");
    strText = strText.replace("<U>", "");
    strText = strText.replace("</U>", "");
    strText = strText.replace("<I>", "");
    strText = strText.replace("</I>", "");
    strText = strText.replace("<STRIKE>", "");
    strText = strText.replace("</STRIKE>", "");
    return strText;
}

// set property 2
function setProperty2(pValue, objInput) {
    var strText = objInput.innerText;
    strText = replaceInnerText(strText);
    if (strText.indexOf("</FONT>") == -1) {
        objInput.innerText = "<FONT style=\"BACKGROUND-COLOR:" + pValue + "\">" + strText + "</FONT>";
    } else {
        var strFind = "BACKGROUND-COLOR:";
        var idxProp = strText.indexOf(strFind);
        if (idxProp == -1) {
            if (pValue != "") {
                objInput.innerText = strText.substring(0, 5) + " style=\"BACKGROUND-COLOR:" + pValue + "\"" + strText.substring(5);
            }
        } else {
            var idxSpaceGT = strText.indexOf(" >");
            if (idxSpaceGT == -1) {
                var idxGT = strText.indexOf(">");
                strText = strText.substring(0, idxGT) + " " + strText.substring(idxGT);
            }
            var remainText = strText.substring(idxProp + strFind.length);
            remainText = remainText.substring(remainText.indexOf(" "));
            if (pValue != "") {
                objInput.innerText = strText.substring(0, idxProp + strFind.length) + "\"" + pValue + "\"" + remainText;
            } else {
                objInput.innerText = strText.substring(0, idxProp) + remainText;
            }
        }
    }
}

// set props
function setProperty3(objInput, pValue) {
    var leftTarget = "<" + pValue + ">";
    var rightTarget = "</" + pValue + ">";
    if (objInput) {
        if (objInput.value.indexOf(leftTarget) > -1 || objInput.value.indexOf(rightTarget) > -1) {
            objInput.value = objInput.value.replace(leftTarget, "");
            objInput.value = objInput.value.replace(rightTarget, "");
        } else {
            objInput.value = leftTarget + objInput.value + rightTarget;
        }
    }
}

// show FCK
function showFCK() {
    var sBasePath = "./module/fckeditor/";
    var oFCKeditor = new FCKeditor("content");
    oFCKeditor.BasePath = sBasePath;
    oFCKeditor.ReplaceTextarea();
}

// html to text
function HTML2TXT(str) {
    var RexStr = /\<|\>|\"|\'|\&/g;
    str = str.replace(RexStr, function(MatchStr) {
        switch (MatchStr) {
            case "<":
                return "& lt;";
                break;
            case ">":
                return "& gt;";
                break;
            case "\"":
                return "& quot;";
                break;
            case "'":
                return "& #39;";
                break;
            case "&":
                return "& amp;";
                break;
            default:
                break;
        }
    });
    return str;
}

// show Html In Iframe
function showHtmlInIframe(o, f) {
    var obj = eval("document.all." + o);
    var ifx = eval(f);
    if (obj && obj.value.length > 0) {
        if (ifx.document == null || ifx.document == "undefined") {
            alert("Loading ...");
        }
        temp = obj.value.replace("&lt;", "<");
        temp = obj.value.replace("&gt;", ">");
        temp = obj.value.replace(/(onmouse)/g, "minyoo");
        ifx.document.body.innerHTML = temp;
    }
}

// init Page Setting
function initPageSetting(l, n, f) {
    var l = eval("document.all." + l);
    var n = eval("document.all." + n);
    var thisform = eval("document." + f);
    thisform.action = l.value + n.value;
    thisform.submit();
}

// do function
function doFunc(func) {
    setTimeout(func, 1);
}

// check url
function checkURL(url) {
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.open("GET", url, false);
    xmlhttp.send();
    if (xmlhttp.readyState == 4) {
        return xmlhttp.Status == 200 ? true : false;
    } else {
        return false;
    }
}

// replace html
function replaceHTML(obj) {
    var o = eval("document.all." + obj);
    if (o) {
        var strHTML = o.value;
        strHTML = strHTML.replace(/<\/(.*)>/, "");
        strHTML = strHTML.replace(/<[^>]*>/, "");
        o.value = strHTML;
    }
}

// get title
function getTitle(obj) {
    var link = document.all.link.value;
    var stype = parent.document.all.stype.value;
    var file = obj.innerHTML;
    if (link == null || link.length == 0 || stype == null || stype != "image") {
        obj.title = obj.innerHTML;
    } else {
        obj.title = "<img src='" + link + "/" + file + "' width='200' height='150' border='0' style='filter:alpha(opacity=100)'>";
    }
}

// get title name
function getTitleName(obj) {
    obj.title = obj.innerHTML;
}

// get alt
function getalt() {
    if (event.srcElement.title && (event.srcElement.title != "" || (event.srcElement.title == "" && tempalt != ""))) {
        altlayer.style.left = event.x;
        altlayer.style.top = event.y + 20;
        altlayer.style.display = "";
        tempalt = event.srcElement.title;
        tempbg = event.srcElement.altbg;
        tempcolor = event.srcElement.altcolor;
        tempborder = event.srcElement.altborder;
        event.srcElement.title = "";
        altlayer.innerHTML = tempalt;
        if (typeof (tempbg) != "undefined") {
            altlayer.style.background = tempbg;
        } else {
            altlayer.style.background = "infobackground";
        }
        if (typeof (tempcolor) != "undefined") {
            altlayer.style.color = tempcolor;
        } else {
            altlayer.style.color = tempcolor = "infotext";
        }
        if (typeof (tempborder) != "undefined") {
            altlayer.style.border = "0px solid " + tempborder;
        } else {
            altlayer.style.border = "0px solid #EEEEEE";
        }
    }
}

// quick alt
function quickalt() {
    if (altlayer.style.display == "") {
        altlayer.style.left = event.x;
        altlayer.style.top = event.y + 10;
    }
}

// restore alt
function restorealt() {
    event.srcElement.title = tempalt;
    tempalt = "";
    altlayer.style.display = "none";
}

// insertAttachment
function insertAttachment() {
    var checkobj = new Array();
    var nameobj = new Array();
    var fileobj = new Array();
    var selectobj = new Array();
    var selectname = new Array();
    var n = 0;
    if (!document.all.checkbox) {
        return;
    }
    checkobj[n] = document.all.checkbox.checked;
    n++;
    for (i = 0; i < listsize - 1; i++) {
        var cobj = eval("document.all.checkbox_" + i);
        if (cobj == null || cobj == "undefined") {
            break;
        } else {
            checkobj[n] = cobj.checked;
            n++;
        }
    }
    var j = 0;
    var pattern = /getTitle\(this\).+</g;
    var pattern2 = /getTitle\(this\)[^>]+/g;
    var text = document.all.tablerow.innerHTML;
    var result;
    while ((result = pattern.exec(text)) != null) {
        var obj = result[0];
        obj = obj.replace(pattern2, "");
        obj = obj.replace("getTitle(this)", "");
        obj = obj.replace("\">", "");
        obj = obj.replace(">", "");
        obj = obj.replace("</A> <", "");
        fileobj[j] = obj;
        j++;
    }
    j = 0;
    pattern = /getTitleName\(this\).+</g;
    pattern2 = /getTitleName\(this\)[^>]+/g;
    text = document.all.tablerow.innerHTML;
    while ((result = pattern.exec(text)) != null) {
        var obj = result[0];
        obj = obj.replace(pattern2, "");
        obj = obj.replace("getTitleName(this)", "");
        obj = obj.replace("\">", "");
        obj = obj.replace(">", "");
        obj = obj.replace("</A> <", "");
        nameobj[j] = obj;
        j++;
    }
    if (checkobj == null || fileobj == null || checkobj.length != fileobj.length) {
        return;
    }
    var k = 0;
    var parentfck = parent.document.all.fckvalue;
    var parentibl = parent.document.all.imagebuttonvalue;
    var parentico = parent.document.all.iconvalue;
    for (m = 0; m < checkobj.length; m++) {
        if (checkobj[m] == true) {
            selectobj[k] = fileobj[m];
            selectname[k] = nameobj[m];
            k++;
        }
    }
    if (parentfck) {
        for (i = 0; i < selectobj.length; i++) {
            parentfck.innerHTML += getFCKObjectLink(selectobj[i], selectname[i], (i + 1));
        }
    }
    if (parentibl) {
        if (selectobj.length > 0) {
            parentibl.innerHTML = getImageButtonLink(selectobj[0]);
        }
    }
    if (parentico) {
        if (selectobj.length > 0) {
            parentico.innerHTML = getIconLink(selectobj[0]);
        }
    }
    ok();
}

// insert default
function insertDefault() {
    var checkobj = new Array();
    var nameobj = new Array();
    var selectobj = new Array();
    var selectname = new Array();
    var n = 0;
    if (!document.all.checkbox) {
        return;
    }
    checkobj[n] = document.all.checkbox.checked;
    n++;
    for (i = 0; i < listsize - 1; i++) {
        var cobj = eval("document.all.checkbox_" + i);
        if (cobj == null || cobj == "undefined") {
            break;
        } else {
            checkobj[n] = cobj.checked;
            n++;
        }
    }
    var j = 0;
    pattern = /getTitleName\(this\).+</g;
    pattern2 = /getTitleName\(this\)[^>]+/g;
    text = document.all.tablerow.innerHTML;
    while ((result = pattern.exec(text)) != null) {
        var obj = result[0];
        obj = obj.replace(pattern2, "");
        obj = obj.replace("getTitleName(this)", "");
        obj = obj.replace("\">", "");
        obj = obj.replace(">", "");
        obj = obj.replace("</A> <", "");
        nameobj[j] = obj;
        j++;
    }
    if (checkobj == null) {
        return;
    }
    var k = 0;
    for (m = 0; m < checkobj.length; m++) {
        if (checkobj[m] == true) {
            selectname[k] = nameobj[m];
            k++;
        }
    }
    var ret = "";
    for (i = 0; i < selectname.length; i++) {
        ret += (i > 0 ? " " : "") + selectname[i];
    }
    window.returnValue = ret;
    parent.close();
}

// tell ok
function ok() {
    alert("\u64cd\u4f5c\u6210\u529f\uff01\u60a8\u53ef\u4ee5\u7ee7\u7eed\u8fdb\u884c\u64cd\u4f5c\u6216\u70b9\u3010\u53d6\u6d88\u3011\u3010\u8fd4\u56de\u3011\u6309\u94ae\u8fd4\u56de\u3002");
}

// get icon link
function getIconLink(obj) {
    var link = document.all.link.value;
    var stype = parent.document.all.stype.value;
    var ret = obj;
    var link = link + "/" + obj;
    if (stype == "image") {
        ret = "<IMG SRC=\"" + link + "\" BORDER=\"0\">";
    }
    return ret;
}

// get image button link
function getImageButtonLink(obj) {
    var link = document.all.link.value;
    var stype = parent.document.all.stype.value;
    var ret = obj;
    var link = link + "/" + obj;
    if (stype == "image") {
        ret = "<INPUT TYPE=\"image\" SRC=\"" + link + "\" BORDER=\"0\">&nbsp;";
    }
    return ret;
}

// get fck object link
function getFCKObjectLink(obj, linkName, linkNo) {
    var link = document.all.link.value;
    var stype = parent.document.all.stype.value;
    var ret = obj;
    var link = link + "/" + obj;
    // stype: image flash video attach plugin
    if (stype == "image") {
        ret = "<BR><IMG SRC=\"" + link + "\" BORDER=\"0\" onmouseout='hiddenBigImage()' onmousemove='showBigImage(\"" + obj.split(".")[0] + "\")' />";
    } else {
        if (stype == "flash") {
            ret = "<BR><EMBED src=\"" + link + "\" quality=\"high\" bgcolor=\"#FFFFFF\" WIDTH=\"300\" HEIGHT=\"250\" NAME=\"myMovieName\" ALIGN=\"center\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>";
        } else {
            if (stype == "video") {
                ret = "<BR><EMBED src=\"" + link + "\" style=\"display:\" quality=\"high\" width=\"300\" height=\"250\" controls=\"StatusBar,ControlPanel\" autostart=\"true\" loop=\"true\">";
            } else {
                if (stype == "attach") {
                    ret = "<BR>\u9644\u4ef6" + linkNo + "\u3001<A HREF=\"" + link + "\">" + linkName + "</A>";
                } else {
                    if (stype == "plugin") {
                        ret = "<BR>[plugin name=" + obj + "]";
                    }
                }
            }
        }
    }
    return ret + "&nbsp;";
}

// insert object to fck
function insertObjToFCKEditor() {
    var obj = document.all.fckvalue;
    if (obj) {
        var charValue = obj.innerHTML;
        oEditor.FCK.InsertHtml(charValue);
    }
}

// insert object to fck for image button
function insertObjToFCKEditor2() {
    var obj = document.all.imagebuttonvalue;
    if (obj) {
        var charValue = obj.innerHTML;
        oEditor.FCK.InsertHtml(charValue);
    }
}

// insert object inoto inputbox
function insertObjIntoInputbox() {
    var obj = document.all.iconvalue;
    if (obj) {
        window.returnValue = obj.innerHTML;
    }
}

// set selected items values
function setSelectedItems(formname, sourceobj) {
    var eo = eval("document." + formname + ".elements");
    var so = eval("document." + formname + "." + sourceobj);
    if (eo == null || so == null) {
        return;
    }
    var split = so.value.split(".");
    if (split == null || split.length == 0) {
        return;
    }
    for (var j = 0; j < split.length; j++) {
        for (var i = 0; i < eo.length; i++) {
            var e = eo[i];
            if ((e.type == "checkbox") && (!e.disabled)) {
                if (e.value * 1 == split[j] * 1) {
                    e.checked = true;
                }
            }
        }
    }
}

// move some
function moveSome(formname) {
    var temp = "";
    var eo = eval("document." + formname + ".elements");
    if (eo == null) {
        return temp;
    }
    for (var i = 0; i < eo.length; i++) {
        var e = eo[i];
        if ((e.type == "checkbox") && (!e.disabled)) {
            if (e.checked) {
                // get only one target column
                temp = e.value;
                break;
            }
        }
    }
    if (temp.length > 0) {
        document.all.selectedCols.value = temp;
    }
}

// sync some
function syncSome() {
    var values = getSelectedRowsValues("treeForm", ".");
    if (values.length > 0) {
        document.all.selectedCols.value = values;
    }
}

// related some
function relatedSome() {
    var values = getSelectedRowsValues("treeForm", ".");
    if (values.length > 0) {
        document.all.relatedCols.value = values;
    }
}

// issue all
function issueAll() {
    if (confirm("\u60a8\u786e\u5b9a\u8981\u53d1\u5e03\u6574\u4e2a\u7f51\u7ad9\u5417\uff1f")) {
        return true;
    } else {
        return false;
    }
}

// issue some
function issueSome() {
    var values = getSelectedRowsValues("treeForm", ".");
    if (values.length < 1) {
        alert("\u8bf7\u9009\u62e9\u9700\u8981\u53d1\u5e03\u7684\u680f\u76ee\uff01");
        return false;
    } else {
        document.all.selectedCols.value = values;
        return true;
    }
}

// insert object inoto inputbox
function insertObjIntoInputbox2() {
    var values = getSelectedRowsValues("treeForm", ".");
    var titles = getSelectedRowsTitles("treeForm", ",");
    var ret = Array();
    ret[0] = values;
    ret[1] = titles;
    window.returnValue = ret;
    window.close();
}

// get checkbox selected items values
function getSelectedRowsValues(formname, split) {
    var temp = "";
    var eo = eval("document." + formname + ".elements");
    if (eo == null) {
        return temp;
    }
    for (var i = 0; i < eo.length; i++) {
        var e = eo[i];
        if ((e.type == "checkbox") && (!e.disabled)) {
            if (e.checked) {
                temp += (temp.length > 0) ? split : "";
                temp += e.value;
            }
        }
    }
    return temp;
}

// get checkbox selected items titles
function getSelectedRowsTitles(formname, split) {
    var temp = "";
    var eo = eval("document." + formname + ".elements");
    if (eo == null) {
        return temp;
    }
    for (var i = 0; i < eo.length; i++) {
        var e = eo[i];
        if ((e.type == "checkbox") && (!e.disabled)) {
            if (e.checked) {
                temp += (temp.length > 0) ? split : "";
                temp += e.title;
            }
        }
    }
    return temp;
}

// select template from template table list
function selectTemplate(tpltype) {
    var features = "dialogWidth:780px;dialogHeight:533px;dialogLeft:" + (screen.width - 620) / 2 + "px;" + "dialogTop:50px;directories:no;location:no;menubar:no;status=no;toolbar=no;scrollbars:no;Resizeable=no";
    var sp = tpltype + "," + document.all.colid.value;
    var page = document.all.link.value + "/app?page=TemplateSelect&service=page&sp=" + sp;
    window.showModalDialog(page, window, features);
    window.location.reload();
}

// select template from plugin
function selectTemplate2(tpltype, flag) {
    var features = "dialogWidth:780px;dialogHeight:533px;dialogLeft:" + (screen.width - 620) / 2 + "px;" + "dialogTop:50px;directories:no;location:no;menubar:no;status=no;toolbar=no;scrollbars:no;Resizeable=no";
    var sp = tpltype + "," + flag + document.all.sid.value;
    var page = document.all.link.value + "/app?page=TemplateSelect&service=page&sp=" + sp;
    window.showModalDialog(page, window, features);
    window.location.reload();
}

// template select show
function guestbookTplSelectShow() {
    var state = document.all.state;
    var savetpl = document.all.savetpl;
    var listtpl = document.all.listtpl;
    if (savetpl && listtpl && state) {
        if (state.value * 1 == 1) {
            savetpl.style.display = "none";
            listtpl.style.display = "none";
        } else {
            savetpl.style.display = "none";
            listtpl.style.display = "none";
        }
    }
}

// do template select flag
function doFlagForTemplateSelect() {
    var tpltype = document.all.tpltype;
    var flag = document.all.flag;
    var colid = document.all.colid;
    if (colid == null || flag == null) {
        alert("template error, please check your code!");
        return;
    }
    tpltype.value = parent.document.all.tpltype.value;
    colid.value = parent.document.all.colid.value;
    if (flag.value == "1") {
        parent.close();
    }
}

// int iframe link
function initPageLink() {
    var colid = document.all.colid;
    var tif = document.all.tif;
    var link = document.all.link;
    var temptpl = document.all.temptpl;
    var idxtpl = document.all.idxtpl;
    var coltpl = document.all.coltpl;
    var arttpl = document.all.arttpl;
    var searchtpl = document.all.searchtpl;
    if (tif == null || link == null || temptpl == null || idxtpl == null || coltpl == null || arttpl == null || searchtpl == null) {
        return;
    }
    tif.src = link.value + temptpl.value;
    if (colid.value == "1") {
        document.all.idxtpltd.style.display = "";
    } else {
        document.all.idxtpltd.style.display = "none";
    }
}

// int iframe link
function initPageLink2() {
    var tif = document.all.tif;
    var link = document.all.link;
    var temptpl = document.all.temptpl;
    var saveTplName = document.all.saveTplName;
    var listTplName = document.all.listTplName;
    if (tif == null || link == null || temptpl == null || saveTplName == null || listTplName == null) {
        return;
    }
    tif.src = link.value + temptpl.value;
}

// do page set
function doPageSet(obj) {
    var tif = document.all.tif;
    var link = document.all.link;
    var app = document.all.app;
    var colid = document.all.colid.value;
    var tpl = eval("document.all." + obj + "tplid");
    if (tif == null || link == null || tpl == null) {
        return;
    }
    tif.src = link.value + app.value + tpl.value + "," + obj + "," + colid;
}
/**
* insert object at caret
* textEl control object
* text insert text
* 
**/
function storeCaret(textEl) {
    if (textEl.createTextRange) {
        textEl.caretPos = document.selection.createRange().duplicate();
    }
}
function insertAtCaret(textEl, text) {
    text = (text == 0) ? "" : text;
    if (textEl.createTextRange && textEl.caretPos) {
        var caretPos = textEl.caretPos;
        caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == "" ? text + "" : text;
    } else {
        textEl.value = textEl.value + text;
    }
}

// openWin
function openWin(url) {
    window.open(url, "blocksetwin", "width=400, height=100, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no");
}

// control block type 
function controlBlockType() {
    var bt = document.all.enabledType;
    var ps = document.all.paramset;
    var cs = document.all.codeset;
    var ss = document.all.styleshow;
    var cd = document.all.codeedit;
    var wd = document.all.wordctrl;
    var pn = document.all.picctrl;
    var np = document.all.normalparam;
    var pp = document.all.picparam;
    var oc = document.all.otherctrl;
    if (bt) {
        if (bt.value * 1 == 0) {
            ps.style.display = "none";
            cs.style.display = "none";
            ss.style.display = "none";
            cd.style.display = "none";
        } else {
            if (bt.value * 1 == 1) {
                ps.style.display = "none";
                cs.style.display = "none";
                ss.style.display = "none";
                cd.style.display = "";
            } else {
                if (bt.value * 1 == 4 || bt.value * 1 == 7) {
                    ps.style.display = "none";
                    cs.style.display = "";
                    ss.style.display = "";
                    cd.style.display = "none";
                } else {
                    ps.style.display = "";
                    cs.style.display = "";
                    ss.style.display = "";
                    cd.style.display = "none";
                    if (bt.value * 1 == 8) {
                        wd.style.display = "";
                        oc.style.display = "none";
                        np.style.display = "none";
                        pn.style.display = "";
                        pp.style.display = "";
                    } else {
                        wd.style.display = "";
                        np.style.display = "";
                        oc.style.display = "";
                        pn.style.display = "none";
                        pp.style.display = "none";
                    }
                    if (bt.value * 1 == 2 || bt.value * 1 > 8) {
                        oc.style.display = "none";
                    }
                }
            }
        }
        contorlColSelect();
        clickParentWin();
    }
}

// submit selected item
function submitSelectedItem() {
    document.all.updateButton.click();
}

// click parent window
function clickParentWin() {
    var parentbut = eval("opener.parent.document.all." + document.all.parentbut.value);
    if (parentbut) {
        parentbut.click();
    }
}

// contorl col select
function contorlColSelect() {
    var fx = document.all.fromx.value * 1;
    var sc = document.all.selectcol;
    if (fx == 1 || fx == 2 || fx == 3) {
        sc.style.display = "";
    } else {
        sc.style.display = "none";
    }
}

// select icon from images table list
function selectIconFromImages(objstr) {
    var features = "dialogWidth:780px;dialogHeight:533px;dialogLeft:" + (screen.width - 620) / 2 + "px;" + "dialogTop:50px;directories:no;location:no;menubar:no;status=no;toolbar=no;scrollbars:no;Resizeable=no";
    var page = document.all.link.value + "/app?page=AttachmentIcon&service=page&sp=4";
    var val = window.showModalDialog(page, window, features);
    if (val != null) {
        var obj = eval("document.all." + objstr);
        if (obj) {
            obj.value = val;
        }
    }
}

// select default info
function selectDefault(objstr, linkstr) {
    var features = "dialogWidth:780px;dialogHeight:533px;dialogLeft:" + (screen.width - 620) / 2 + "px;" + "dialogTop:50px;directories:no;location:no;menubar:no;status=no;toolbar=no;scrollbars:no;Resizeable=no";
    var page = document.all.link.value + "/app?page=" + linkstr + "&service=page";
    var val = window.showModalDialog(page, window, features);
    if (val != null) {
        var obj = eval("document.all." + objstr);
        if (obj) {
            obj.value = val;
        }
    }
}
// select article from other
function selectArticleFromOther() {
    var webid = document.all.webid;
    var cid = document.all.cid;
    if (!webid || !cid) {
        alert("webid or cid is not valid!");
    }
    var sp = webid.value + "." + cid.value;
    var features = "dialogWidth:" + screen.width + "px;dialogHeight:600px;dialogLeft:0px;dialogTop:50px;directories:no;location:no;menubar:no;status=no;toolbar=no;scrollbars:no;Resizeable=no";
    var page = document.all.link.value + "/app?page=ArticleSelect&service=page&sp=" + sp;
    window.showModalDialog(page, window, features);
}

// select icon from images table list
function selectColFromColumns(oid, oname) {
    var features = "dialogWidth:780px;dialogHeight:533px;dialogLeft:" + (screen.width - 620) / 2 + "px;" + "dialogTop:50px;directories:no;location:no;menubar:no;status=no;toolbar=no;scrollbars:no;Resizeable=no";
    var page = document.all.link.value + "/app?page=ColumnNode&service=page";
    var val = window.showModalDialog(page, window, features);
    if (val != null) {
        var oi = eval("document.all." + oid);
        var on = eval("document.all." + oname);
        if (oi) {
            oi.value = val[0];
        }
        if (on) {
            on.value = val[1];
            on.title = val[1];
        }
    }
}

// set image size
function selectImageSize() {
    var w = document.all.imgwidth;
    var h = document.all.imgheight;
    var a = document.all.RecommendedSize.value.split(",");
    if (a) {
        w.value = a[0];
        h.value = a[1];
    }
    var scaleimg = document.all.scaleimg;
    if (!document.all.srcw.value) {
        document.all.srcw.value = document.all.scaleimg.offsetWidth;
    }
    if (!document.all.srch.value) {
        document.all.srch.value = document.all.scaleimg.offsetHeight;
    }
    var srcw = document.all.srcw.value * 1;
    var srch = document.all.srch.value * 1;
    if (scaleimg.readyState == "complete") {
        srcw = (w.value * 1 > srcw) ? srcw : w.value;
        srch = (h.value * 1 > srch) ? srch : h.value;
    }
    document.all.scaleimg.width = srcw;
    document.all.scaleimg.height = srch;
}

// set image size
function setImageSize() {
    var maxw = 620;
    var maxh = 340;
    var w = document.all.imgwidth;
    var h = document.all.imgheight;
    var scaleimg = document.all.scaleimg;
    if (!document.all.srcw.value) {
        document.all.srcw.value = document.all.scaleimg.offsetWidth;
    }
    if (!document.all.srch.value) {
        document.all.srch.value = document.all.scaleimg.offsetHeight;
    }
    var srcw = document.all.srcw.value * 1;
    var srch = document.all.srch.value * 1;
    if (scaleimg.readyState == "complete") {
        srcw = (w.value * 1 > srcw) ? srcw : w.value;
        srch = (h.value * 1 > srch) ? srch : h.value;
    }
    document.all.scaleimg.width = srcw;
    document.all.scaleimg.height = srch;
}

// init scale image
function initScaleImg() {
    document.all.scaleimg.src = document.all.scalesrc.value;
}

// control User Edit
function controlUserEdit() {
    var state = document.saveForm.state;
    var userName = document.saveForm.userName;
    if (state && userName) {
        if (state.value * 1 == 1) {
            //userName.readOnly = true;
            userName.style.color = "blue";
        }
    }
}

// select column's editos or admins from user table list
function selectUsers(nameObj, userNameObj) {
    var sid = document.all.sid;
    var name = eval("document.all." + nameObj);
    var userName = eval("document.all." + userNameObj);
    if (sid == null || name == null || userName == null) {
        return false;
    }
    var features = "dialogWidth:580px;dialogHeight:563px;dialogLeft:" + (screen.width - 620) / 2 + "px;" + "dialogTop:50px;directories:no;location:no;menubar:no;status=no;toolbar=no;scrollbars:no;Resizeable=no";
    var page = document.all.link.value + "/app?page=ColumnSet&service=page&sp=" + sid.value + "," + nameObj;
    var obj = window.showModalDialog(page, window, features);
    if (obj != null) {
        name.value = obj;
        userName.value = obj;
    } else {
        name.value = "";
        userName.value = "";
    }
}

// get selected users
function getSelectedUser() {
    var itemSelected = "";
    if (!document.all.checkbox) {
        return;
    }
    if (document.all.checkbox.checked) {
        itemSelected += document.all.usernameget.value + ".";
    }
    for (var j = 0; j < document.all.entryCount.value - 1; j++) {
        var obj = eval("document.all.checkbox_" + j);
        if (obj && obj.checked) {
            itemSelected += eval("document.all.usernameget_" + j).value + ".";
        }
    }
    var len = itemSelected.length;
    if (len > 0 && document.all.objGet) {
        document.all.objGet.value = itemSelected.substring(0, len - 1);
        window.returnValue = document.all.objGet.value;
    }
    parent.close();
}

// get selected users
function initColParams() {
    var thisUser = document.all.thisUser;
    var adminUser = document.all.adminUser;
    var cot = document.all.cot;
    var aud = document.all.aud;
    var iss = document.all.iss;
    var adw = document.all.adw;
    var flg = document.all.flg;
    var tps = document.all.tps;
    var eds = document.all.eds;
    var ads = document.all.ads;
    var admins = document.all.admins;
    if (thisUser && adminUser && admins && ((admins.value.indexOf(thisUser.value) > -1)) || thisUser.value == adminUser.value) {
        cot.style.display = "";
        aud.style.display = "";
        iss.style.display = "";
        adw.style.display = "";
        flg.style.display = "";
        tps.style.display = "";
        eds.style.display = "";
        ads.style.display = "";
    } else {
        cot.style.display = "none";
        aud.style.display = "none";
        iss.style.display = "none";
        adw.style.display = "none";
        flg.style.display = "none";
        tps.style.display = "none";
        eds.style.display = "none";
        ads.style.display = "none";
    }
}

// init issue page
function initIssuePage() {
    var thisUser = document.all.thisUser;
    var adminUser = document.all.adminUser;
    if (thisUser && adminUser && thisUser.value == adminUser.value) {
        document.all.issueAllButton.style.display = "";
    } else {
        document.all.issueAllButton.style.display = "none";
    }
}

// show back image button
function backShow(obj1, obj2) {
    var obj1 = eval("document.all." + obj1);
    var obj2 = eval("document.all." + obj2);
    if (obj1 && obj2) {
        if (obj1.value != null && obj1.value != "X") {
            obj2.style.display = "";
        }
    }
}

// hidden big image
function hiddenBigImage() {
    /*
    var x, y, layer;
    mlayer = document.getElementById("MinyooArticleLayer");
    if (mlayer) {
    mlayer.innerHTML = "";
    mlayer.style.display = "none";
    }
    */
}

// show big image
function showBigImage(id) {
    alert(1);
    /*
    var x, y, mlayer;
    x = event.clientX;
    y = event.clientY;
    mlayer = document.getElementById("MinyooArticleLayer");
    if (mlayer) {
    mlayer.style.left = x;
    mlayer.style.top = y;
    mlayer.innerHTML = "<img src="/image.minyoo?id=" + id + "">";
    mlayer.style.display = "block";
    }
    */
}

